package com.qihe.reviewj2se;

public class M1 extends java.lang.Thread {

	public void m1() {
		for (int i = 0; i < 100; i++) {
			System.out.println("m1 " + i);
		}
	}
	
	public static void main(String[] args) {
		new M1().start();
		new M2().start();
	}

	@Override
	public void run() {
		m1();
	}
	
}

class M2 extends java.lang.Thread {

	public void m2() {
		for (int i = 0; i < 100; i++) {
			System.out.println("m2 " + i);
		}
	}
	
	@Override
	public synchronized void run() {
		m2();
	}
	
}
